/*
 * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package me.qixiaobo.util;

/**
 * 响应结果生成工具
 *
 */
public class ResultGenerator {

    private ResultGenerator() {

    }

    public static ResultModel genSuccessResult() {
        return new ResultModel(ResultStatusEnum.SUCCESS);
    }

    public static ResultModel genSuccessResult(Object data) {
        return new ResultModel(ResultStatusEnum.SUCCESS, data);
    }

    public static ResultModel genFailResult(String message) {
        return new ResultModel(ResultStatusEnum.FAIL.getStatus(), message);

    }

    public static ResultModel genCodeResult(int code, String message) {
        return new ResultModel(code, message);
    }

}
